package com.free.front.controller.variableSpeed;

import com.deco.dao.domain.table.Variablespeed;
import com.deco.service.VariableSpeed.VarialbleSpeedService;
import com.free.common.vo.ResultModel;
import com.free.front.bf.product.ProductVinSearchBf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 说明：
 * 创建人：Q879095880
 */
@Controller
public class VarialbleSpeedController {
    @Autowired
    VarialbleSpeedService varialbleSpeedService;

    @Autowired
    ProductVinSearchBf productVinSearchBf;

    /**
     * 变速箱查询
     * @param variablespeed
     * @return
     */
    @RequestMapping(value = "/getList.json")
    @ResponseBody
    public ResultModel getList(Variablespeed variablespeed){
        return varialbleSpeedService.getList(variablespeed);
    }

    /**
     * 模糊查询
     * @param brand
     * @return
     */
    @RequestMapping(value = "/getLike.json")
    @ResponseBody
    public ResultModel getLike(String brand){
        return varialbleSpeedService.getLike(brand);
    }

    /**
     * 根据品牌获取车型
     * @param variablespeed
     * @return
     */
    @RequestMapping(value = "/getByBrand.json")
    @ResponseBody
    public ResultModel getByBrand(Variablespeed variablespeed){
        return varialbleSpeedService.getByBrand(variablespeed);
    }


    /**
     * 获取详细信息
     * @param variablespeed
     * @return
     */
    @RequestMapping(value = "/getInfo.json")
    @ResponseBody
    public ResultModel getInfo(Variablespeed variablespeed){
        return varialbleSpeedService.getInfo(variablespeed);
    }


    /**
     * 根据车型获取年份
     * @param variablespeed
     * @return
     */
    @RequestMapping(value = "/getByvehicletype.json")
    @ResponseBody
    public ResultModel getByvehicletype(Variablespeed variablespeed){
        return varialbleSpeedService.getByvehicletype(variablespeed);
    }


    /**
     * vim查询
     * @param vin
     * @return
     */
    @RequestMapping("/getByVarialbleVinCode.json")
    @ResponseBody
    public ResultModel getByVarialbleVinCode(String vin){
        return productVinSearchBf.getByVarialbleVinCode(vin);
    }


}
